package com.hzqy.persistence.dao.activity;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.PmsUserVo;
import com.hzqy.web.vo.UserBillVo;
import com.hzqy.web.vo.activity.AcContentActionVo;
import com.hzqy.web.vo.activity.ActivityAwardVo;
import com.hzqy.web.vo.activity.ActivityViewButtonVo;
import com.hzqy.web.vo.activity.ActivityViewVo;
import com.hzqy.web.vo.activity.QuestionContentVo;

@Repository
public class ActivityModelDao  extends PersistenceDao<PmsUserVo, Integer>{
	protected final Logger LOG = LoggerFactory.getLogger(getClass());

	public AcContentActionVo selectActivity(String activityid) {
		return getSqlSession().selectOne(this.getNamespace() + "selectActivity", activityid);
	}

	public List<ActivityViewVo> selectActivityView(Map<String, Object> map) {
		return getSqlSession().selectList(this.getNamespace() + "selectActivityView",map);
	}

	public List<ActivityViewButtonVo> selectActivityViewButtons(int f_av_id) {
		return getSqlSession().selectList(this.getNamespace() + "selectActivityViewButtons",f_av_id);
	}

	public List<ActivityAwardVo> selectActivityAward(Map<String, String> map) {
		return getSqlSession().selectList(this.getNamespace() + "selectActivityAward",map);
	}
	
	/**
	 * 查询当前在线的所有活动
	 * @return
	 */
	public List<AcContentActionVo> selectOnlineActivity(){
		return getSqlSession().selectList(this.getNamespace() + "selectOnlineActivity");
	}
	
	public int insertUserBill(UserBillVo userBillVo) {
		return getSqlSession().insert(this.getNamespace() + "insertUserBill", userBillVo);
	}
	
	public AcContentActionVo selectContentAction(String activityid){
		return getSqlSession().selectOne(this.getNamespace() + "selectContentAction", activityid);
	}
}
